# Codebook

## Data Overview
This dataset contains information about inter-municipal cooperation (IMC) across multiple services in Catalonian municipalities from 2011-2022. The data includes municipal characteristics, electoral information, and cooperation patterns.

## Data Files

- **table1_data.rds**: Data for service adoption patterns
- **table3_data.rds**: Data for descriptive statistics
- **table4_data.rds**: Data for GLMM analysis including population size
- **table5_data.rds**: Data for GLMM analysis including population density
- **table6_data.rds**: Data for survival analysis
- **tablesm1_data.rds**: Data for GLMM analysis including population size and density
- **tablesm2_data.rds**: Data for survival analysis with population density
- **tablesm3_data.rds**: Data for survival analysis with differences in vote shares

## Services Analyzed
- Waste treatment
- Waste collection
- Transport
- Fire services
- Public Libraries
- Civil protection
- Drinking water
- Sewerage

## Variable Descriptions

Variable Name in R | Description | Type | Notes
-------------------|-------------|------|-------
`muni` | Municipality name | Character | Unique identifier
`id` | Municipality ID | Numeric | Unique identifier
`service` | Type of service | Character | Eight different services
`year` | Year of observation | Numeric | 2011-2022
`imc_dummy` | IMC adoption status | Binary | 1 = adopted, 0 = not adopted
`EUROS_HABITANT` | Per capita debt | Numeric | Municipal debt per resident
`population` | Municipality population | Numeric | Minimum 500 residents
`population_squared` | Squared population | Numeric | Used for non-linear effects
`VOTANTS_PERCENT` | Voter turnout | Numeric | Percentage of registered voters
`Densitat..hab..km..`| Density | Numeric| Number of inhabitants per km2

## Transformations
- Population variables are scaled using `scale()`
- Skewed variables are transformed using log or exponential transformations when skewness > |1|
- All continuous variables are standardized for analysis

## Analytical Models

### 1. Generalized Linear Mixed Models (GLMM)
- Random effects: municipality and year
- Fixed effects: population, population squared, turnout, debt
   
### 2. Cox Proportional Hazards Models
- Time variable: years since first adoption
- Event: IMC adoption
- Covariates: population, population squared, debt, turnout
